namespace go admin_orders
include "common.thrift"
include "error_code.thrift"

struct Order {
    1: i64 ID(api.body="id")
    2: i64 GoodsID(api.body="goods_id")
    3: string OrderNumber(api.body="order_number")
    4: i64 SubmitTime(api.body="submit_time")
    5: i64 PayTime(api.body="pay_time")
    6: string Nickname(api.body="nickname")
    7: common.OrderStatus Status(api.body="status")
    8: common.PayStatus PayStatus(api.body="pay_status")
    9: double TotalPrice(api.body="total_price")
    10:i64 UserID(api.body="user_id")
}

struct OrderDetail {
    1: i64 ID(api.body="id")
    2: i64 GoodsID(api.body="goods_id")
    3: string OrderNumber(api.body="order_number")
    4: i64 SubmitTime(api.body="submit_time")
    5: i64 PayTime(api.body="pay_time")
    6: string Nickname(api.body="nickname")
    7: common.OrderStatus Status(api.body="status")
    8: common.PayStatus PayStatus(api.body="pay_status")
    9: double TotalPrice(api.body="total_price")
    10:i64 UserID(api.body="user_id")
    11:string ReceiverName(api.body="receiver_name")
    12:string ReceiverEmail(api.body="receiver_email")
    13:string ReceiverMobile(api.body="receiver_mobile")
    14:string ReceiverProvince(api.body="receiver_province")
    15:string ReceiverCity(api.body="receiver_city")
    16:string ReceiverRegion(api.body="receiver_region")
    17:string ReceiverAddress(api.body="receiver_address")
    18:string DeliveryNumber(api.body="delivery_number")
    19:list<OrderItem> OrderItem(api.body="order_item")
    20:string Remark(api.body="remark")
}

struct OrderItem {
    1: i64 ID(api.body="id")
    2: string GoodsName(api.body="goods_name")
    3: string GoodsIcon(api.body="goods_icon")
    4: double Price(api.body="price")
    5: i64 Number(api.body="number")
    6: double TotalPrice(api.body="total_price")
}


struct GetOrderListRequest {
    1: i64 Page = 1 (api.query="page");
    2: i64 Size = 20 (api.query="size");
}

struct GetOrderListResponse {
    1: error_code.ErrorCode Code (api.body='code')
    2: list<Order> Data (api.body='data')
    3: i64 Page (api.body='page')
    4: i64 Size (api.body='size')
}


struct UpdateOrderRequest {
    1: i64 ID (api.body="id")
    2: string Name (api.body='name')
}

struct UpdateOrderResponse {
    1: error_code.ErrorCode Code (api.body='code')
    2: Order Data (api.body='data')
}


struct GetOrderInfoRequest {
    1: i64 ID (api.query="id")
}

struct GetOrderInfoResponse {
    1: error_code.ErrorCode Code (api.body='code')
    2: Order Data (api.body='data')
}

struct DeliveryOrderRequest {
    1: i64 OrderID (api.body="order_id")
    2: i64 DeliveryCompanyID (api.body='delivery_company_id')
    3: string DeliveryNumber (api.body='delivery_number')
}

struct DeliveryOrderResponse {
    1: error_code.ErrorCode Code (api.body='code')
    2: Order Data (api.body='data')
}

struct GetOrderDetailRequest {
    1: i64 ID (api.query="id")
}

struct GetOrderDetailResponse {
    1: error_code.ErrorCode Code (api.body='code')
    2: OrderDetail Data (api.body='data')
}

struct RemarkOrderRequest {
    1: i64 ID (api.body="id")
    2: string Remark (api.body='remark')
}

struct RemarkOrderResponse {
    1: error_code.ErrorCode Code (api.body='code')
}